package com.zmn.plat.common.dictionary;

/**
 * 标准类型枚举
 *
 * @author linfeng
 * @since 2020/02/13 14:56:30
 */
public enum StandardCategoryEnum {

    /**
     * values
     */
    NOTICE(1, "公告类"),
    CONTRACT(2, "合同、协议类"),
    BUSINESS_PROCESS(3, "业务流程、岗位操作"),
    SERVICE_PRODUCT_STANDARD(4, "服务产品标准类"),
    RULE_AND_REGULATIONS(5, "规章制度类"),
    ;

    private Integer code;
    private String name;

    StandardCategoryEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static StandardCategoryEnum of(Integer code) {
        if (code == null || code == 0) {
            return NOTICE;
        }
        switch (code) {
            case 1:
                return NOTICE;
            case 2:
                return CONTRACT;
            case 3:
                return BUSINESS_PROCESS;
            case 4:
                return SERVICE_PRODUCT_STANDARD;
            case 5:
                return RULE_AND_REGULATIONS;
            default:
                return NOTICE;
        }
    }
}
